package org.haredot.convertor;

import org.springframework.core.convert.converter.Converter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class StringToListLongConvertor implements Converter<String, List<Long>> {

    @Override
    public List<Long> convert(String source) {
        String[] split = source.split(",");
        List<Long> list = new ArrayList<>();
        Arrays.stream(split).forEach(x -> list.add(Long.parseLong(x)));
        return list;
    }
}
